<template>
  <div style="width: 100%; height: 90%; background: white; margin: 0 auto; overflow: auto;">
    <el-row>
        <el-col :span="24">
        <p style="font-family: SiYuanBold; color: rgb(207, 139, 50); font-size: 24px; text-align: center;">志愿推荐结果</p>
        <!-- <p data-v-b7cf5276="" style="font-family: Oswald; color: rgb(187, 187, 187); font-size: 10px;text-align: center;">COLLEGE MAJOR GUIDE</p> -->
        </el-col>
    </el-row>
    <el-row style="color:#969696;width: 65%; margin: 0 auto;">
      <el-col :span="15">
        <el-row>
          <!-- <el-col :span="12">
            <div class="gdap-avatar">
              {{avatarText}}
            </div>
          </el-col> -->
          <el-col :span="18">
            <p><span>语种：{{language}} </span>   <span style="margin-left:2em">科类：{{cate}}</span></p>
           <p> <span>分数：{{score}}  </span>   <span  style="margin-left:3.2em"> 排名：{{rate}}</span></p>
            <p v-if="areaItem.length > 0">地域条件：
              <el-tag v-for="area in areaItem" type="primary">
                {{area}}
              </el-tag>
            </p>
            <p v-else>
              地域条件：&nbsp;无
            </p>
            <p v-if="zyListObj.length > 0">专业条件：
              <el-tag v-for="item in zyListObj" type="primary">
                {{item.name}}
              </el-tag>
            </p>
            <p v-else>
              专业条件:&nbsp;无
            </p>
          </el-col>
        </el-row>
      </el-col>
      <el-col :span="9">
        <div>
          <p style="color:#F56C6C"><i class="el-icon-warning"></i>注意说明：</p>
          <p>推荐级别：
            <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" style="opacity:0.8;margin:-0.5em 0.2em"/>地域匹配
            <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" style="opacity:0.8;margin:-0.5em 0.2em"/>专业匹配
            <img src="http://222.82.250.217:81/nceeSysMgr/bg3.jpg" style="opacity:0.8;margin:-0.5em 0.2em"/>无匹配
          </p>
          <p>
            专业类别：
            <el-tag type="success">专业匹配，可填报 </el-tag>
            <el-tag type="warning">专业匹配，可尝试</el-tag>
            <el-tag type="danger">可填报</el-tag>
          </p>
          <p>
            录取概率：
            <span style="color: #F56C6C;">冲刺：30%以下</span>&nbsp;&nbsp;
            <span style="color: #E6A23C">适中：30%-70%</span>&nbsp;&nbsp;
            <span style="color: green">保底：70%以上</span>
          </p>
          <!-- <p style="color:#F56C6C"><i class="el-icon-warning"></i>温馨提示：</p>
          <p>2018年招生计划已更新，志愿推荐以最新数据为依据！</p> -->
          <p>您还有<span style="color:#F56C6C">{{recommendNum}}</span>次院校志愿推荐机会</p>
          <!-- <p>您还有<span style="color:#F56C6C">{{recommendNum}}</span>次院校志愿推荐机会{{info}}</p> -->
          <!-- <p>为您匹配到<span style="color:#F56C6C">{{editXYNum}}</span>所推荐院校推荐完成</p> -->
        </div>
      </el-col>
    </el-row>
    <hr/>

    <el-row>
      <div>
        <!-- <el-col :span="8">
          <p style="text-align: center;color: #F56C6C;"><span>您还有{{recommendNum}}次院校志愿推荐机会</span>{{info}}</p>
        </el-col>
        <el-col :span="10">&nbsp;</el-col>
        <el-col :span="6">
          <p style="color: #F56C6C;">为您匹配到{{editXYNum}}所推荐院校推荐完成</p>
        </el-col> -->
        <!-- 批次1 -->
        <el-table
                :data="pc1TableData"
                style="width: 80%; margin: 0 auto;"
                v-if="showPc1"
                >
          <el-table-column
                  type="index"
                  label="序号"
                  width="120">
          </el-table-column>
          <el-table-column
                  prop="pcmc"
                  label="批次"
                  width="150">
          </el-table-column>
          <el-table-column
                  prop="yx"
                  label="推荐院校"
                  width="250">
          </el-table-column>
          <el-table-column
                  label="推荐级别"
                  width="120">
            <template slot-scope="scope">
              <div v-if="scope.row.isAdditional === '0'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" style="opacity:0.8"/>
                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '1'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '2'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '3'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg3.jpg" style="opacity:0.8"/>
              </div>
            </template>
          </el-table-column>
          <el-table-column
                  label="推荐专业"
                  width="450">
            <template slot-scope="scope">
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'A'" type="success">{{item.zymc}}</el-tag>
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'B'" type="warning">{{item.zymc}}</el-tag>
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'C'" type="danger">{{item.zymc}}</el-tag>
            </template>
          </el-table-column>
          <el-table-column
                  label="概率"
                  width="120">
            <template slot-scope="scope">
              <span v-if="scope.row.gl > 0.7" style="color: green;">
                {{scope.row.gl | numFilter}}
              </span>
              <span v-if="(scope.row.gl > 0.3 && scope.row.gl <= 0.7)" style="color: orange;">
                {{scope.row.gl | numFilter}}
              </span>
              <span v-if="(scope.row.gl > 0 && scope.row.gl <= 0.3)" style="color:#FB6F6A">
                {{scope.row.gl | numFilter}}
              </span>
            </template>
          </el-table-column>
          <el-table-column
                  prop="zsjhs"
                  label="招生数"
                  width="120">
          </el-table-column>
          <el-table-column
                  fixed="right"
                  label="推荐理由"
                  width="120">
            <template slot-scope="scope">
              <el-button
                      @click.native.prevent="recommendReason(scope)"
                      type="text"
                      size="small">
                查看详情
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <!-- 批次2 -->
        <el-table
                :data="pc2TableData"
                style="width: 80%; margin: 0 auto;"
                v-if="showPc2"
        >
          <el-table-column
                  type="index"
                  label="序号"
                  width="120">
          </el-table-column>
          <el-table-column
                  prop="pcmc"
                  label="批次"
                  width="150">
          </el-table-column>
          <el-table-column
                  prop="yx"
                  label="推荐院校"
                  width="250">
          </el-table-column>
          <el-table-column
                  label="推荐级别"
                  width="120">
            <template slot-scope="scope">
              <div v-if="scope.row.isAdditional === '0'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" style="opacity:0.8"/>
                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '1'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '2'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '3'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg3.jpg" style="opacity:0.8"/>
              </div>
            </template>
          </el-table-column>
          <el-table-column
                  label="推荐专业"
                  width="450">
            <template slot-scope="scope">
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'A'" type="success">{{item.zymc}}</el-tag>
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'B'" type="warning">{{item.zymc}}</el-tag>
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'C'" type="danger">{{item.zymc}}</el-tag>
            </template>
          </el-table-column>
          <el-table-column
                  label="概率"
                  width="120">
            <template slot-scope="scope">
                <span v-if="scope.row.gl > 0.7" style="color: green;">
                  {{scope.row.gl | numFilter}}
                </span>
              <span v-if="(scope.row.gl > 0.3 && scope.row.gl <= 0.7)" style="color: orange;">
                  {{scope.row.gl | numFilter}}
                </span>
              <span v-if="(scope.row.gl > 0 && scope.row.gl <= 0.3)" style="color:#FB6F6A;">
                  {{scope.row.gl | numFilter}}
                </span>
            </template>
          </el-table-column>
          <el-table-column
                  prop="zsjhs"
                  label="招生数"
                  width="120">
          </el-table-column>
          <el-table-column
                  fixed="right"
                  label="推荐理由"
                  width="120">
            <template slot-scope="scope">
              <el-button
                @click.native.prevent="recommendReason(scope)"
                type="text"
                size="small">
                查看详情
              </el-button>
            </template>
          </el-table-column>
        </el-table>

        <!-- 批次5 -->
        <el-table
                :data="pc5TableData"
                style="width: 80%; margin: 0 auto;"
                v-if="showPc5"
        >
          <el-table-column
                  type="index"
                  label="序号"
                  width="120">
          </el-table-column>
          <el-table-column
                  prop="pcmc"
                  label="批次"
                  width="150">
          </el-table-column>
          <el-table-column
                  prop="yx"
                  label="推荐院校"
                  width="250">
          </el-table-column>
          <el-table-column
                  label="推荐级别"
                  width="120">
            <template slot-scope="scope">
              <div v-if="scope.row.isAdditional === '0'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" style="opacity:0.8"/>
                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '1'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '2'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" style="opacity:0.8"/>
              </div>
              <div v-if="scope.row.isAdditional === '3'">
                <img src="http://222.82.250.217:81/nceeSysMgr/bg3.jpg" style="opacity:0.8"/>
              </div>
            </template>
          </el-table-column>
          <el-table-column
                  label="推荐专业"
                  width="450">
            <template slot-scope="scope">
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'A'" type="success">{{item.zymc}}</el-tag>
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'B'" type="warning">{{item.zymc}}</el-tag>
              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'C'" type="danger">{{item.zymc}}</el-tag>
            </template>
          </el-table-column>
          <el-table-column
                  label="概率"
                  width="120">
            <template slot-scope="scope">
                <span v-if="scope.row.gl > 0.7" style="color: green;">
                  {{scope.row.gl | numFilter}}
                </span>
              <span v-if="(scope.row.gl > 0.3 && scope.row.gl <= 0.7)" style="color: orange;">
                  {{scope.row.gl | numFilter}}
                </span>
              <span v-if="(scope.row.gl > 0 && scope.row.gl <= 0.3)" style="color:#FB6F6A;">
                  {{scope.row.gl | numFilter}}
                </span>
            </template>
          </el-table-column>
          <el-table-column
                  prop="zsjhs"
                  label="招生数"
                  width="120">
          </el-table-column>
          <el-table-column
                  fixed="right"
                  label="推荐理由"
                  width="120">
            <template slot-scope="scope">
              <el-button
                @click.native.prevent="recommendReason(scope)"
                type="text"
                size="small">
                查看详情
              </el-button>
            </template>
          </el-table-column>
        </el-table>

        <!-- h批次暂不使用 2019-04-19 -->
        <!-- h1批次 -->
<!--        <el-table-->
<!--                :data="pcH1TableData"-->
<!--                style="width: 90%; margin: 0 auto;"-->
<!--                v-if="showH1Pc"-->
<!--        >-->
<!--          <el-table-column-->
<!--                  type="index"-->
<!--                  label="序号"-->
<!--                  width="50">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="pcmc"-->
<!--                  label="批次"-->
<!--                  width="120">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="yx"-->
<!--                  label="推荐院校"-->
<!--                  width="160">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="偏好级别"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--              <div v-if="scope.row.isAdditional === '0'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" />-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '1'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '2'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '3'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg3.jpg" />-->
<!--              </div>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="推荐专业"-->
<!--                  width="400">-->
<!--            <template slot-scope="scope">-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'C'" type="danger">{{item.zymc}}</el-tag>-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'B'" type="warning">{{item.zymc}}</el-tag>-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'A'" type="success">{{item.zymc}}</el-tag>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="概率"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--                <span v-if="scope.row.gl > 0.7" style="color: green;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--              <span v-if="(scope.row.gl > 0.3 && scope.row.gl <= 0.7)" style="color: orange;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--              <span v-if="(scope.row.gl > 0 && scope.row.gl <= 0.3)" style="color: red;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="zsjhs"-->
<!--                  label="计划招生数"-->
<!--                  width="120">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  fixed="right"-->
<!--                  label="推荐理由"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--              <el-button-->
<!--                      @click.native.prevent="deleteRow(scope.$index, tableData)"-->
<!--                      type="text"-->
<!--                      size="small">-->
<!--                Remove-->
<!--              </el-button>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--        </el-table>-->
<!--        &lt;!&ndash; h2批次 &ndash;&gt;-->
<!--        <el-table-->
<!--                :data="pcH2TableData"-->
<!--                style="width: 90%; margin: 0 auto;"-->
<!--                v-if="showH2Pc"-->
<!--        >-->
<!--          <el-table-column-->
<!--                  type="index"-->
<!--                  label="序号"-->
<!--                  width="50">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="pcmc"-->
<!--                  label="批次"-->
<!--                  width="120">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="yx"-->
<!--                  label="推荐院校"-->
<!--                  width="160">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="偏好级别"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--              <div v-if="scope.row.isAdditional === '0'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" />-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '1'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '2'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '3'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg3.jpg" />-->
<!--              </div>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="推荐专业"-->
<!--                  width="400">-->
<!--            <template slot-scope="scope">-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'C'" type="danger">{{item.zymc}}</el-tag>-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'B'" type="warning">{{item.zymc}}</el-tag>-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'A'" type="success">{{item.zymc}}</el-tag>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="概率"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--                <span v-if="scope.row.gl > 0.7" style="color: green;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--              <span v-if="(scope.row.gl > 0.3 && scope.row.gl <= 0.7)" style="color: orange;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--              <span v-if="(scope.row.gl > 0 && scope.row.gl <= 0.3)" style="color: red;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="zsjhs"-->
<!--                  label="计划招生数"-->
<!--                  width="120">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  fixed="right"-->
<!--                  label="推荐理由"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--              <el-button-->
<!--                      @click.native.prevent="deleteRow(scope.$index, tableData)"-->
<!--                      type="text"-->
<!--                      size="small">-->
<!--                Remove-->
<!--              </el-button>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--        </el-table>-->
<!--        &lt;!&ndash; h5批次 &ndash;&gt;-->
<!--        <el-table-->
<!--                :data="pcH5TableData"-->
<!--                style="width: 90%; margin: 0 auto;"-->
<!--                v-if="showH5Pc"-->
<!--        >-->
<!--          <el-table-column-->
<!--                  type="index"-->
<!--                  label="序号"-->
<!--                  width="50">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="pcmc"-->
<!--                  label="批次"-->
<!--                  width="120">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="yx"-->
<!--                  label="推荐院校"-->
<!--                  width="160">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="偏好级别"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--              <div v-if="scope.row.isAdditional === '0'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" />-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '1'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg2.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '2'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg1.jpg" />-->
<!--              </div>-->
<!--              <div v-if="scope.row.isAdditional === '3'">-->
<!--                <img src="http://222.82.250.217:81/nceeSysMgr/bg3.jpg" />-->
<!--              </div>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="推荐专业"-->
<!--                  width="400">-->
<!--            <template slot-scope="scope">-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'C'" type="danger">{{item.zymc}}</el-tag>-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'B'" type="warning">{{item.zymc}}</el-tag>-->
<!--              <el-tag v-for="item in scope.row.zy" v-if="item.zytype === 'A'" type="success">{{item.zymc}}</el-tag>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  label="概率"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--                <span v-if="scope.row.gl > 0.7" style="color: green;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--              <span v-if="(scope.row.gl > 0.3 && scope.row.gl <= 0.7)" style="color: orange;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--              <span v-if="(scope.row.gl > 0 && scope.row.gl <= 0.3)" style="color: red;">-->
<!--                  {{scope.row.gl | numFilter}}-->
<!--                </span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  prop="zsjhs"-->
<!--                  label="计划招生数"-->
<!--                  width="120">-->
<!--          </el-table-column>-->
<!--          <el-table-column-->
<!--                  fixed="right"-->
<!--                  label="推荐理由"-->
<!--                  width="120">-->
<!--            <template slot-scope="scope">-->
<!--              <el-button-->
<!--                      @click.native.prevent="deleteRow(scope.$index, tableData)"-->
<!--                      type="text"-->
<!--                      size="small">-->
<!--                Remove-->
<!--              </el-button>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--        </el-table>-->
      </div>
      <el-col :span="24" style="text-align: center; margin-top: 10px;">
        <el-button @click="backToHome">返回首页</el-button>
        <el-button @click="backPrevPage" type="success">返回上一页</el-button>
        <el-button type="primary" @click="research">重新查询</el-button>
      </el-col>
    </el-row>

    <!-- 预测入口迁移至首页 -->
<!--    <el-row>-->
<!--      <el-button @click="openEstimate">预测服务</el-button>-->
<!--    </el-row>-->


  </div>
</template>
<script>
import api from '@/utils/api'
import {categoryList} from "../../constants/constants"

export default {
  data() {
    return {
      areaItem: '',
      cate: '',
      avatarText: '',
      language: '',
      score: '',
      rate:'',
      item:'',
      pc1TableData: [],
      pc2TableData: [],
      pc5TableData: [],
      // h1, 2, 5为民考汉
      pcH1TableData: [],
      pcH2TableData: [],
      pcH5TableData: [],
      showPc1: false,
      showPc2: false,
      showPc5: false,
      // h1, 2, 5为民考汉
      showH1Pc: false,
      showH2Pc: false,
      showH5Pc: false,
      recommendNum: '',
      editXYNum: '',
      info: '',
      estimateFormVisible: false,
      zyListObj: ''
    }
  },
  components: {
  },
  filters: {
    numFilter(val) {
     
         var realVal = Number(val * 100).toFixed(2)
         console.log(realVal, ' --- real val')
         if (realVal == 100.00) {
           realVal = 99.99 + '%'
         } else if (realVal == 0) {
           realVal = 0.01 + '%'
         } else {
           realVal = realVal + '%'
         }
         return realVal
      
     
    }
  },
  mounted() {
    
    const params = localStorage.getItem('estimateparam')
    this.score = JSON.parse(params).zf
    this.language = JSON.parse(params).yzmc
    this.rate=JSON.parse(params).px
    this.areaItem=(JSON.parse(params).areaSet === ''|| JSON.parse(params).areaSet === '无') ? [] : JSON.parse(params).areaSet.split(',')
    console.log(JSON.parse(params).areaSet, ' area set')
    this.zyListObj = JSON.parse(params).zyListObj === undefined ? []  : JSON.parse(params).zyListObj
    console.log(JSON.parse(params).zyListObj, ' zy set')
    const areaSet = JSON.parse(params).areaSet
    console.log(areaSet.split(','))

    for (const i in categoryList) {
      if (categoryList[i].value === JSON.parse(params).kldm) {
        this.cate = categoryList[i].label
        this.avatarText = this.cate.substr(0, 1)
      }
    }
    if (JSON.parse(localStorage.getItem('user'))) {
      api({
        url: 'nceeSysMgr/rest/sendPost/analysis/rest/getPossibilityRecs',
        method: 'post',
        data: params
      })
      .then(res => {
        if (res.status === 200) {
          this.recommendNum = res.data.recommendNum
          this.$notify({
            message: res.data.info,
            type: 'success'
          })
          this.editXYNum = res.data.editXYNum
          this.info = res.data.info
          this.pc1TableData = (res.data.hasOwnProperty(1) && res.data['1'].length > 0) ? (this.showPc1 = true, res.data['1']) : ''
          this.pc2TableData = (res.data.hasOwnProperty(2) && res.data['2'].length > 0) ? (this.showPc2 = true, res.data['2']): ''
          this.pc5TableData = (res.data.hasOwnProperty(5) && res.data['5'].length > 0) ? (this.showPc5 = true, res.data['5']) : ''
        } else {
          
          this.$notify({
            title: 'Warning',
            message: '未知错误，请重新查询',
            type: 'warning'
          })
        }
      })
    } else {
      api({
        url: '/analysis/rest/getPossibilityRecs',
        method: 'post',
        data: params
      })
      .then(res => {
        if (res.status === 200) {
          this.recommendNum = res.data.recommendNum
          this.$notify({
            message: res.data.info,
            type: 'success'
          })
          this.editXYNum = res.data.editXYNum
          this.info = res.data.info
          this.pc1TableData = (res.data.hasOwnProperty(1) && res.data['1'].length > 0) ? (this.showPc1 = true, res.data['1']) : ''
          this.pc2TableData = (res.data.hasOwnProperty(2) && res.data['2'].length > 0) ? (this.showPc2 = true, res.data['2']): ''
          this.pc5TableData = (res.data.hasOwnProperty(5) && res.data['5'].length > 0) ? (this.showPc5 = true, res.data['5']) : ''
        } else {
          
          this.$notify({
            title: 'Warning',
            message: '未知错误，请重新查询',
            type: 'warning'
          })
        }
      })
    }
  },
  methods: {
    backPrevPage() {
      this.$router.go(-1)
    },
    backToHome() {
      this.$router.push('/')
      this.$store.state.common.stepIndex = 0
    },
    research() {
      if (JSON.parse(localStorage.getItem('user'))) {
        this.$router.push('/step/estimatescore')
        this.$store.state.common.stepIndex = 0
      } else {
        this.$router.push('/step/choosearea')
        this.$store.state.common.stepIndex = 1
      }
      
    },
    openEstimate() {
      this.estimateFormVisible = true
    },
    recommendReason(scope) {
      const recommendParam = {
        yxdm: scope.row._id,
        pcdm: scope.row.pcdm,
        gl: scope.row.gl,
        zy: scope.row.zy
      }
      localStorage.setItem('recommendParam', JSON.stringify(recommendParam))
      this.$router.push({name: 'recommendreason', params: {yxdm: scope.row._id, pcdm: scope.row.pcdm, gl: scope.row.gl, zy: scope.row.zy}})
    },
    openNotify() {
      // this.$notify({
      //   title: 'Warning',
      //   message: '未知错误，请重新查询',
      //   type: 'warning'
      // })
    }
  }
}

</script>
<style>
  .gdap-avatar {
    width: 10rem;
    height: 10rem;
    border-radius: 5rem;
    line-height: 10rem;
    background: #ffd373;
    color: #ffffff;
    font-size: 4rem;
    text-align: center;
    margin-left: 5rem;
    margin-top: 3vh;
  }
  .el-table__fixed, .el-table__fixed-right{
    -webkit-box-shadow:0;
    box-shadow:none
  }
</style>
